package com.lxq.test2104.main02;

import jdk.nashorn.internal.ir.ContinueNode;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n,L,r,t,sum = 0;
        n = sc.nextInt();//长宽
        L = sc.nextInt();//灰度值
        r = sc.nextInt();//范围
        t = sc.nextInt();//阈值

        int[][] graph = new int[n+1][n+1];//图像
        int[][] preFixSum = new int[n+1][n+1];//前缀和数组
        double[][] avg = new double[n][n];//某点r领域的平均值数组

        for (int i=1 ; i<=n ; i++){
            for (int j=1 ; j<=n ;j++){
                graph[i][j] = sc.nextInt();
            }
        }

        //求二维数组前缀和
        for (int i=1 ; i<=n ; i++){
            for (int j=1 ; j<=n ;j++){
                preFixSum[i][j] = graph[i][j] + preFixSum[i-1][j] + preFixSum[i][j-1] - preFixSum[i-1][j-1];

            }

        }

        //求某领域内的平均值[i-r,j-r]~[i+r,j+r]
        for (int i=1 ; i<=n ; i++){
            for (int j=1 ; j<=n ;j++){
                int x1 = i-r , y1 = j-r;
                int x2 = i+r , y2 = j+r;

                //边界处理
                if (x1<1){
                    x1 = 1;
                }
                if (y1<1){
                    y1 = 1;
                }
                if (x2>n){
                    x2 = n;
                }
                if (y2>n){
                    y2 = n;
                }
                
                double flag = preFixSum[x2][y2] - preFixSum[x1-1][y2] - preFixSum[x2][y1-1] + preFixSum[x1-1][y1-1];
                avg[i-1][j-1] = flag/((x2-x1+1)*(y2-y1+1));

            }

        }

        for (int i=0 ; i<n ; i++){
            for (int j=0 ; j<n ; j++){
                if (avg[i][j]<=t){
                    sum++;
                }
            }
        }
        System.out.println(sum);
    }
}
